import 'package:flutter/material.dart';

class BuildWidget extends StatefulWidget {
  AppBar? appBar;

  @override
  _BuildWidgetState createState() => _BuildWidgetState();
}

class _BuildWidgetState extends State<BuildWidget> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: widget.appBar != null ? widget.appBar : null,
        body: Container(
          // 控件高度
//          constraints: new BoxConstraints.expand(
//            height: 120.0,
//          ),
          //设置背景图片
          decoration: new BoxDecoration(
            color: Colors.grey,
//            border: new Border.all(width: 2.0, color: Colors.red),
//            borderRadius: new BorderRadius.all(new Radius.circular(20.0)),
            image: new DecorationImage(
              // 本地读取图片资源
              //image: new AssetImage('images/WDTG3707.jpeg'),
              // 网络图片资源
              image: new NetworkImage(
                  'https://gitee.com/Mr.bai/blog_img/raw/master/life/20211215/20211215161022.jpg'),
              //这里是从assets静态文件中获取的，也可以new NetworkImage(）从网络上获取
              centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),
            ),
          ),
          alignment: Alignment.center,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [Text('正在建设中...')],
          ),
        ));
  }
}
